<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>Promise</title>
</head>
<body>
<!--<script src="//cdn.bootcss.com/es6-promise/3.2.2/es6-promise.min.js"></script>-->
<script src="//cdn.bootcss.com/nlp_compromise/6.3.1/nlp_compromise.js"></script>
<script>
    var callback=function(){
        alert("callbackcallbackcallbackcallbackcallbackcallback");
    }
    var showMsg = function(){
        // 构造promise实例
        var promise = new Promise();
        setTimeout(function (){
            alert("PromisePromisePromisePromisePromisePromise");
            callback();
            // 改变promise的状态
            promise.resolve('resolved');
        },1000 );
        // 返回promise实例
        return promise;
    };
    showMsg();
</script>
</body>
</html>